﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProjectListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%if (Model.Projects != null && Model.Projects.Count > 0)
     {
         var first = Model.Projects[0]; %> 
<div class="bor_cor content mar_t" style="overflow:hidden;">
    <div class="heading_bar">
        <div class="heading_bar_tit">
            <a href="/project/list/<%=Model.Category.ID %>"><%=Html.Encode(Model.Category.Name) %></a>
        </div>    
    </div>
    <div class="xtt"><a href="/project/list/<%=Model.Category.ID %>">Xem tất cả</a></div>
    <div class="heading_bar_line"></div>
    <div class="tt_pad ">
        <div class="clear"></div>
        <div class="tt_2col_l pad">        
            <div>
                <a href="/project/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>">
                    <% string imgPath = (first.ImagePath != null && first.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(first.ID, 299, 207, first.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                    <img src="<%=imgPath %>" title="<%=first.Title %>" alt="<%=first.Title %>" class="bor_img" width="299" height="207" style="overflow:hidden"/>
                </a>
            </div>
            <h2><a href="/project/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>" style="color:#E14326"><%=Html.Encode(first.Title) %></a></h2>
            <p style="padding-right:10px"><%=Html.Encode(first.Summary.Length>95? first.Summary.Substring(0,95)+"...": first.Summary) %></p>
            <p style="padding-right:10px"><strong>Vị trí</strong>:<%=Html.Encode(first.Address)%></p> 
        </div>
        <div class="tt_2col_r pad">
            <%if (Model.Projects.Count > 1)
            { %>
   	          <%for (int i = 1; i < Model.Projects.Count; i++)
                {
                    string imgPath1 = (Model.Projects[i].ImagePath != null && Model.Projects[i].ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Projects[i].ID, 101, 72, Model.Projects[i].ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo;
                     var css = i == 1 ? "pad" : "";
                 %>
   	                <div class="tt_duan_img">
   	                    <a href="/project/details/<%=Model.Projects[i].ID %>/<%=Html.ToUrlFriendly(Model.Projects[i].Title)%>">
   	                        <img class="bor_img" src="<%=imgPath1 %>" title="<%=Model.Projects[i].Title %>" alt="<%=Model.Projects[i].Title %>" width="101" height="72" />
   	                     </a>
   	                </div>
                    <div class="tt_duan_cnt <%=css %>">
           	          <a class="t_org" href="/project/details/<%=Model.Projects[i].ID %>/<%=Html.ToUrlFriendly(Model.Projects[i].Title)%>"><%=Html.Encode(Model.Projects[i].Title)%></a>
           	          <p><strong>Vị trí</strong>:<%=Html.Encode(Model.Projects[i].Address)%></p> 
			        </div>
   	                <div class="clear"></div>                    
               <%} %>
          <%} %>
        </div>
    </div>
</div>
<%} %>
<div class="clear"></div>

